package com.mall.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Data                   //自动生成getter setter方法
@NoArgsConstructor      //生成无参构造函数
@AllArgsConstructor     //生成有参构造函数
public class User {
        private String userId;

        public User(String phone, String password) {
                this.phone = phone;
                this.password = password;
        }

        private String phone;

        private String password;

        private String nickname;

        private String email;

        private String avatar;

        private Integer gender;

        @JsonFormat(pattern = "yyyy-mm-dd")
        private Date birthday;

        @JsonFormat(pattern = "yyyy-mm-dd HH:mm:ss")
        private Date createTime;

        @JsonFormat(pattern = "yyyy-mm-dd HH:mm:ss")
        private Date updateTime;

        @JsonFormat(pattern = "yyyy-mm-dd HH:mm:ss")
        private Date lastLoginTime;
}